﻿<%@ Page Title="" Language="C#" MasterPageFile="~/skin.Master" AutoEventWireup="true" CodeBehind="Forecaster.aspx.cs" Inherits="DataShow.forecasters.Forecaster" %>

<%@ Register Src="/ascx/AddPanel.ascx" TagName="NUD" TagPrefix="UC" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="headers" ContentPlaceHolderID="home_header" runat="server">
    <link rel="stylesheet" href="/css/compiled/form-showcase.css" type="text/css" media="screen" />
    <link href="/css/lib/bootstrap.datepicker.css" type="text/css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="cph_home" runat="server">
    <div style="margin-top: 10px;">
        <ul class="breadcrumb">
            <li><a href="<%:IndexURL %>">首页</a> <span class="divider">/</span></li>
            <li><a href="<%:ForecasterURL %>">预报员</a> <span class="divider">/</span></li>
            <li class="active"><%:UserName %></li>
        </ul>
    </div>
    <div class="row-fluid">
        <div class="span3">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-plus"></i>
                    </span>
                    <h5>加载条件</h5>
                </div>
                <div class="widget-content nopadding">
                    <asp:Button runat="server" ID="btn_search2" Text="搜索" CssClass="btn-primary btn" OnClick="btn_search_Click" />
                    <asp:Button runat="server" ID="btn_add" Text="新增" CssClass="btn-primary btn" OnClick="btn_add_Click" />
                    <h4>日期选择</h4>
                    <div class="field-box">
                        <label>开始日期:</label>
                        <asp:TextBox runat="server" ID="time_begin" CssClass="input-large datepicker" />
                    </div>
                    <div class="field-box">
                        <label>结束日期:</label>
                        <asp:TextBox runat="server" ID="time_end" CssClass="input-large datepicker"  />
                    </div>
                    <hr />
                    <h4 class="inline">要素</h4><br />
                    <asp:CheckBox runat="server" ID="cbx_type_all" Text="全选" ClientIDMode="Static"/>
                    <asp:CheckBoxList ID="cbl_types" runat="server" RepeatColumns="3" RepeatLayout="Table" RepeatDirection="Horizontal" CssClass="types">
                        <asp:ListItem Text="降水" Value="wth" />
                        <asp:ListItem Text="最高温" Value="maxt" />
                        <asp:ListItem Text="最低温" Value="mint" />
                    </asp:CheckBoxList>
                    <hr />
                    <h4 class="inline">起报时刻</h4><br />
                    <asp:CheckBox runat="server" ID="cbx_point_all" Text="全选" ClientIDMode="Static"/>
                    <asp:CheckBoxList ID="cbl_point" runat="server" RepeatColumns="3" RepeatDirection="Horizontal" RepeatLayout="Table" CssClass="points">
                        <asp:ListItem Text="06" Value="H06" />
                        <asp:ListItem Text="10" Value="H10" />
                        <asp:ListItem Text="16" Value="H16" />
                    </asp:CheckBoxList>
                    <hr />
                    <h4 class="inline">时效</h4><br />
                    <asp:CheckBox runat="server" ID="cbx_sx_all" Text="全选" ClientIDMode="Static"/>
                    <asp:CheckBoxList ID="cbl_sx" runat="server" RepeatColumns="3" RepeatDirection="Horizontal" RepeatLayout="Table" CssClass="sxs">
                        <asp:ListItem Text="0_12小时" Value="FD00_12" />
                        <asp:ListItem Text="12_24小时" Value="FD12_24"/>
                        <asp:ListItem Text="0_24小时" Value="FD00_24" />
                        <asp:ListItem Text="24_36小时" Value="FD24_36" />
                        <asp:ListItem Text="36_48小时" Value="FD36_48" />
                        <asp:ListItem Text="24_48小时" Value="FD24_48" />
                        <asp:ListItem Text="48_60小时" Value="FD48_60" />
                        <asp:ListItem Text="60_72小时" Value="FD60_72" />
                        <asp:ListItem Text="48_72小时" Value="FD48_72" />
                        <asp:ListItem Text="72_84小时" Value="FD72_84" />
                        <asp:ListItem Text="84_96小时" Value="FD84_96" />
                        <asp:ListItem Text="72_96小时" Value="FD72_96" />
                        <asp:ListItem Text="96_108小时" Value="FD96_108" />
                        <asp:ListItem Text="108_120小时" Value="FD108_120" />
                        <asp:ListItem Text="96_120小时" Value="FD96_120" />
                    </asp:CheckBoxList>
                    <hr />
                    <h4 class="inline">站点</h4><br />
                    <asp:CheckBox runat="server" ID="cbx_site_all" Text="全选" ClientIDMode="Static" />
                    <asp:CheckBoxList ID="cbl_sites" runat="server" RepeatColumns="5" RepeatDirection="Horizontal" RepeatLayout="Table" CssClass="stations">
                        <asp:ListItem Text="连云港" Value="58044" />
                        <asp:ListItem Text="东海" Value="58036" />
                        <asp:ListItem Text="赣榆" Value="58040" />
                        <asp:ListItem Text="灌云" Value="58047" />
                        <asp:ListItem Text="灌南" Value="58048" />
                    </asp:CheckBoxList>
                    <hr />
                    <asp:Button runat="server" ID="btn_search" OnClick="btn_search_Click" CssClass="btn-primary btn" Visible="true" Text="搜索" />
                </div>
            </div>
        </div>
        <div class="span9">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-plus"></i>
                    </span>
                    <h5>加载结果</h5>
                </div>
                <div class="widget-content nopadding">
                    <asp:GridView runat="server" ID="gv_result" AutoGenerateColumns="false" EmptyDataText="暂无数据" CssClass="table">
                        <Columns>
                            <asp:TemplateField HeaderText="日期">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_date" Text='<%#Eval("Date") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="起报时刻">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_type" Text='<%#Eval("Point") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="发报时刻">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_site" Text='<%#Eval("SendPoint") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="时效">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_scene" Text='<%#Eval("Scene") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="要素">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_scene" Text='<%#Eval("Element") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="城市">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_scene" Text='<%#Eval("City") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="预报值">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbl_scene" Text='<%#Eval("Value") %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    <div class="alert" id="div_nodata" runat="server">
                        <i class="icon-warning-sign"></i>
                        所选条件暂无数据
                    </div>
                    <webdiyer:AspNetPager ID="anp" runat="server"
                        FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" OnPageChanged="anp_PageChanged"
                        PrevPageText="上一页" ShowCustomInfoSection="Left" ShowPageIndexBox="Never" CustomInfoHTML="第%CurrentPageIndex%页，共%PageCount%页，第页显示%PageSize%条"
                        CssClass="paginator" CurrentPageButtonClass="cpb" AlwaysShow="True" CustomInfoSectionWidth="250px">
                    </webdiyer:AspNetPager>
                </div>
            </div>
        </div>
    </div>

    <!-- Modal -->
    <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">新增数据</h3>
        </div>
        <div class="modal-body">
            <div class="field-box inline">
                <label>发报日期:</label>
                <asp:TextBox runat="server" ID="txt_add_time" CssClass="input-large datepicker" />
            </div>
            <div class="field-box inline">
                <label>发报时刻:</label>
                <asp:DropDownList runat="server" ID="ddl_send_point">
                    <asp:ListItem Text="H06" Value="H06" />
                    <asp:ListItem Text="H10" Value="H10" />
                    <asp:ListItem Text="H16" Value="H16" />
                </asp:DropDownList>
            </div>

            <ul id="myTab" class="nav nav-tabs">
                <li class="active"><a href="#home" data-toggle="tab">连云港</a></li>
                <li><a href="#profile" data-toggle="tab">东海</a></li>
                <li><a href="#yg" data-toggle="tab">赣榆</a></li>
                <li><a href="#gy" data-toggle="tab">灌云</a></li>
                <li><a href="#gn" data-toggle="tab">灌南</a></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane fade in active" id="home">
                    <UC:NUD runat="server" ID="und_lyg" StationCode="58044" />
                </div>
                <div class="tab-pane fade" id="profile">
                    <UC:NUD runat="server" ID="und_dh" StationCode="58036" />
                </div>
                <div class="tab-pane fade" id="yg">
                    <UC:NUD runat="server" ID="und_gy" StationCode="58040" />
                </div>
                <div class="tab-pane fade" id="gy">
                    <UC:NUD runat="server" ID="und_guanyun" StationCode="58047" />
                </div>
                <div class="tab-pane fade" id="gn">
                    <UC:NUD runat="server" ID="und_gn" StationCode="58048" />
                </div>
            </div>
        </div>
        <div class="modal-footer">

            <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
            <asp:Button runat="server" ID="btn_save" Text="保存" CssClass="btn-primary btn" OnClick="btn_save_Click" />
        </div>
    </div>


</asp:Content>
<asp:Content runat="server" ID="scripts" ContentPlaceHolderID="home_script">
    <script src="/js/bootstrap.datepicker.js"></script>
    <script type="text/javascript">
        $(function () {

            // datepicker plugin
            $('.datepicker').datepicker({format:'yyyy-mm-dd'}).on('changeDate', function (ev) {
                $(this).datepicker('hide');
            });

            $(".btnup").click(function () {
                var $textbox = $(this).parent().siblings(".txtnumber");
                $textbox.val(parseFloat($textbox.val()) + 0.1);
            })
            $(".btndown").click(function () {
                var $textbox = $(this).parent().siblings(".txtnumber");
                $textbox.val(parseFloat($textbox.val()) - 0.1);
            })

        });



        $("#cbx_type_all").click(function () {
            if (this.checked) {
                $(".types input[type='checkbox']").each(function () {
                    this.checked = true;
                })
            }
            else {
                $(".types input[type='checkbox']").each(function () {
                    this.checked = false;
                })
            }
        })

        $(".types input[type='checkbox']").click(function () {
            var all = true;
            $(".types input[type='checkbox']").each(function () {
                if (!this.checked) {
                    all = false;
                }
            })
            if (all) {
                document.getElementById("cbx_type_all").checked = true;
            } else {
                document.getElementById("cbx_type_all").checked = false;
            }
        })


        $("#cbx_point_all").click(function () {
            if (this.checked) {
                $(".points input[type='checkbox']").each(function () {
                    this.checked = true;
                })
            }
            else {
                $(".points input[type='checkbox']").each(function () {
                    this.checked = false;
                })
            }
        })

        $(".points input[type='checkbox']").click(function () {
            var all = true;
            $(".points input[type='checkbox']").each(function () {
                if (!this.checked) {
                    all = false;
                }
            })
            if (all) {
                document.getElementById("cbx_point_all").checked = true;
            } else {
                document.getElementById("cbx_point_all").checked = false;
            }
        })

        $("#cbx_sx_all").click(function () {
            if (this.checked) {
                $(".sxs input[type='checkbox']").each(function () {
                    this.checked = true;
                })
            }
            else {
                $(".sxs input[type='checkbox']").each(function () {
                    this.checked = false;
                })
            }
        })

        $(".sxs input[type='checkbox']").click(function () {
            var all = true;
            $(".sxs input[type='checkbox']").each(function () {
                if (!this.checked) {
                    all = false;
                }
            })
            if (all) {
                document.getElementById("cbx_sx_all").checked = true;
            } else {
                document.getElementById("cbx_sx_all").checked = false;
            }
        })

        $("#cbx_site_all").click(function () {
            if (this.checked) {
                $(".stations input[type='checkbox']").each(function () {
                    this.checked = true;
                })
            }
            else {
                $(".stations input[type='checkbox']").each(function () {
                    this.checked = false;
                })
            }
        })

        $(".stations input[type='checkbox']").click(function () {
            var all = true;
            $(".stations input[type='checkbox']").each(function () {
                if (!this.checked) {
                    all = false;
                }
            })
            if (all) {
                document.getElementById("cbx_site_all").checked = true;
            } else {
                document.getElementById("cbx_site_all").checked = false;
            }
        })

    </script>
</asp:Content>
